<template>
	<view>
		<uni-nav-bar dark title="选择联赛" :statusBar="true">
			<block slot="left">
				<view class="city">
					<view>
						<text class="uni-nav-bar-text" @click="onOut">退出</text>
					</view>
				</view>
			</block>
		</uni-nav-bar>
		<view class="content">
			<image class="logo" src="@/static/images/none.png"></image>
			<view class="text-area">
				<text class="title">当前还没有可管理的联赛现在就去创建吧</text>
			</view>
		</view>
		<button @click="onCreated" class="create_btn bt cu-btn block  lg round">创建联赛</button>

		<!--  -->
		<uni-popup :safe-area="true" class="caretePopup" ref="popup" background-color="#fff" type="bottom">
			<view class="loginOut">
				<view>是否退出当前账号？</view>
				<view @click="handleLogout">退出</view>
				<view></view>
				<view @click="$refs.popup.close()">取消</view>
			</view>
		</uni-popup>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			onOut() {
				this.$refs.popup.open('bottom');
			},
			onCreated() {
				uni.navigateTo({
					url: '/pages/createCompetition/createCompetition'
				})
			},
			handleLogout() {
			  this.$modal.confirm('确定注销并退出系统吗？').then(() => {
			    this.$store.dispatch('LogOut').then(() => {
			      this.$tab.reLaunch('/pages/index')
			    })
			  })
			}
		},
		onLoad: function() {}
	}
</script>

<style scoped lang="scss">
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.caretePopup {
		z-index: 999;
		.loginOut {
			view {
				height: 100rpx;
				line-height: 100rpx;
				text-align: center;
				font-size: 30rpx;
				&:nth-child(1) {
					color: #8f8f94;
					font-size: 24rpx;
					border-bottom: 1px solid #eee;
				}
				&:nth-child(2) {
					color: red;
				}
				&:nth-child(3) {
					height: 10px;
					background-color: #eee;
				}
			}
			background-color: #fff;
		}
	}
	

	.create_btn {
		position: absolute;
		bottom: 20%;
		width: 80%;
		left: 0;
		right: 0;
		margin: auto;
		color: #fff;
		background-color: $btn-bg-color;
	}

	.logo {
		height: 340rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>